home *** CD-ROM | disk | FTP | other *** search
- /*
- $Id$
- $Log$
- Desc:
- Lang: english
- */
- #include "exec_intern.h"
- #include <exec/ports.h>
-
- /*****************************************************************************
-
- NAME */
- #include <clib/exec_protos.h>
-
- __AROS_LH1(void, ReplyMsg,
-
- /* SYNOPSIS */
- __AROS_LA(struct Message *, message, A1),
-
- /* LOCATION */
- struct ExecBase *, SysBase, 63, Exec)
-
- /* FUNCTION
- Send a message back to where it came from. It's generally not
- wise to access the fields of a message after it has been replied.
-
- INPUTS
- message - a message got with GetMsg().
-
- RESULT
-
- NOTES
-
- EXAMPLE
-
- BUGS
-
- SEE ALSO
- WaitPort(), GetMsg(), PutMsg()
-
- INTERNALS
-
- HISTORY
- 29-10-95 digulla automatically created from
- exec_lib.fd and clib/exec_protos.h
- 17-12-95 digulla Incorporated code by Matthias Fleischner
-
- *****************************************************************************/
- {
- __AROS_FUNC_INIT
- struct MsgPort *port;
-
- /* Protect the message against access by other tasks. */
- Disable();
-
- /* Get replyport */
- port=message->mn_ReplyPort;
-
- /* Not set? Only mark the message as no longer sent. */
- if(port==NULL)
- message->mn_Node.ln_Type=NT_FREEMSG;
- else
- {
- /* Mark the message as replied */
- message->mn_Node.ln_Type=NT_REPLYMSG;
-
- /* Add it to the replyport's list */
- AddTail(&port->mp_MsgList,&message->mn_Node);
-
- /* And trigger the arrival action. */
- switch(port->mp_Flags&PF_ACTION)
- {
- case PA_SIGNAL:
- /* Send a signal */
- Signal((struct Task *)port->mp_SigTask,1<<port->mp_SigBit);
- break;
-
- case PA_SOFTINT:
- /* Raise a software interrupt */
- Cause((struct Interrupt *)port->mp_SoftInt);
- break;
-
- case PA_IGNORE:
- /* Do nothing */
- break;
- }
- }
-
- /* All done */
- Enable();
- __AROS_FUNC_EXIT
- } /* ReplyMsg */
-